uniform vec3 pP;
uniform vec3 pN;
uniform vec4 l;
 
void main()
{
        mat4 m;
        pP = (0.5,0.5,0.5);
        pN = pP/2;
        l = (0.6,0.5,0.4,1.0);
       
        float d = ( ((-1.0 * pN.x) * pP.x) + ((-1.0 * pN.y) * pP.y) + ((-1.0 * pN.z) * pP.z) );
       
        vec4 p = vec4(pN.x, pN.y, pN.z, d);
       
        float dot = (p.x * l.x) + (p.y * l.y) + (p.z * l.z) + (p.w * l.w);
       
        m = mat4(
                dot - (l.x * p.x), -1.0 * (l.x * p.y), -1.0 * (l.x * p.z), -1.0 * (l.x * p.w),
                -1.0 * (l.y * p.x), dot - (l.y * p.y), -1.0 * (l.y * p.z), -1.0 * (l.y * p.w), 
                -1.0 * (l.z * p.x), -1.0 * (l.z * p.y), dot - (l.z * p.z), -1.0 * (l.z * p.w),
                -1.0 * (l.w * p.x), -1.0 * (l.w * p.y), -1.0 * (l.w * p.z), dot - (l.w * p.w)
                );
       
        gl_Position = gl_ModelViewProjectionMatrix * (gl_Vertex * m);
}
